package pers.vinsonws.jianghu.util;

/**
 * @auther vinsonws
 * @date 2018/11/6 16:18
 */
public enum MessageLabel {

    /** 初始化客户端 */
    INITCLENT(":00initclient00:", 0),

    /** 注册 */
    REGISTER(":11register11:", 1),

    /** 登录 */
    LOGIN(":22login22:", 2),

    /** 申请聊天室 */
    APPLYROOM(":33applyroom33:", 3),

    /** 处理申请 */
    DEALAPPLY("44dealapply44", 4),

    /** 更改资料 */
    ALTER(":55alter55:", 5),

    /** 登出 */
    LOGOUT(":66logout66:", 6),

    /** 聊天-一对一 */
    CHAT(":77chat77:", 7),

    /** 聊天-聊天室 */
    CHATROOM(":88chatroom88:", 8),

    /** 聊天-聊天室 */
    USERSEEAPPLY(":99userseeapply99:", 9),

    /** 聊天-聊天室 */
    ADIMSEEAPPLY(":1010adimseeapply1010:", 10),

    /** 聊天-聊天室 */
    ADIMOPERATEAPPLY(":1111adimoperateapply1111:", 11),

    /** 查看在线用户 */
    ONLINEALLUSERS(":1212onlineallusers1212:", 12),

    /** 用户下线 */
    offlineuser(":1313offlineuser1313:", 13);



    private String label;
    private int index;

    private MessageLabel(String label, int index) {
        this.label = label;
        this.index = index;
    }

    public int getIndex() {
        return index;
    }

    public String getLabel() {
        return label;
    }

    public static String getLabel(int index) {
        for (MessageLabel label : MessageLabel.values()) {
            if (label.getIndex() == index) {
                return label.label;
            }
        }
        return null;
    }

}
